import React from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { Layout } from 'antd';

import MainLayout from '@/components/layout/MainLayout';
import HomePage from '@/pages/HomePage';
import LoginPage from '@/pages/auth/LoginPage';

const { Content } = Layout;

const App: React.FC = () => {
  return (
    <Router>
      <Routes>
        {/* 登录页面 */}
        <Route path="/login" element={<LoginPage />} />
        
        {/* 主应用路由 */}
        <Route path="/*" element={
          <MainLayout>
            <Content style={{ margin: '24px 16px', padding: 24, minHeight: 280 }}>
              <Routes>
                <Route index element={<HomePage />} />
                <Route path="dashboard" element={<HomePage />} />
                {/* 其他路由将在后续添加 */}
              </Routes>
            </Content>
          </MainLayout>
        } />
      </Routes>
    </Router>
  );
};

export default App;